package com.ahuan.mapper;

import com.ahuan.domain.LoginTop;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface StatisticMapper {

    @Select("SELECT count(1) as value,username as name\n" +
            "FROM user_action\n" +
            "GROUP BY username \n" +
            "ORDER BY value\n" +
            "LIMIT 5")
    List<LoginTop> selectLoginTop();

    @Select("SELECT SUM(num) as value\n" +
            "FROM goods_log\n" +
            "GROUP BY month \n" +
            "ORDER BY month\n" +
            "LIMIT 12")
    List<LoginTop> selectRuku();
}
